package com.clstu.properties;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

public class Properties02 {
    public static void main(String[] args) throws IOException {
        Properties properties = new Properties();//1.创建Properties对象
        properties.load(new FileReader("src\\mysql.properties"));//2.load(加载指定配置文件）
        //properties.list(System.out);//3.list（把k-v显示控制台）,全部都会显示
        String user = properties.getProperty("user");
        String ip = properties.getProperty("ip");
        System.out.println("ip========="+ip);
        System.out.println("user========="+user);


    }
}
